<template>
    <div class="lr-layout-container">
        <div class="lr-layout-header">
            <el-button class="back-home-btn" type="success" plain @click="goToHome">
                <i class="el-icon-back"></i>
                返回首页
            </el-button>
        </div>
        
        <div class="lr-layout-content">
            <div class="lr-layout-sidebar">
                <div class="sidebar-header">
                    <div class="logo-container">
                        <svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
                            <rect width="56" height="56" rx="14" fill="#4caf50" />
                            <path d="M14 28 L28 14 L42 28" stroke="#ffffff" stroke-width="3" fill="none"/>
                            <path d="M21 42 L28 35 L35 42" stroke="#81c784" stroke-width="3" fill="none"/>
                            <circle cx="28" cy="28" r="6" fill="#81c784"/>
                        </svg>
                    </div>
                    <h1 class="platform-name">智慧农业科技平台</h1>
                    <p class="platform-slogan">数据驱动的现代农业解决方案</p>
                </div>
                
                <div class="sidebar-features">
                    <div class="feature-card">
                        <div class="feature-icon">
                            <i class="el-icon-s-finance"></i>
                        </div>
                        <div class="feature-info">
                            <h3>智能金融</h3>
                            <p>灵活的农业金融解决方案</p>
                        </div>
                    </div>
                    
                    <div class="feature-card">
                        <div class="feature-icon">
                            <i class="el-icon-s-goods"></i>
                        </div>
                        <div class="feature-info">
                            <h3>产销对接</h3>
                            <p>直连产地与市场，减少中间环节</p>
                        </div>
                    </div>
                    
                    <div class="feature-card">
                        <div class="feature-icon">
                            <i class="el-icon-s-promotion"></i>
                        </div>
                        <div class="feature-info">
                            <h3>数据分析</h3>
                            <p>提供市场趋势和销售数据分析</p>
                        </div>
                    </div>
                </div>
                
                <div class="sidebar-decoration">
                    <svg width="220" height="120" viewBox="0 0 220 120" fill="none" xmlns="http://www.w3.org/2000/svg">
                        <path d="M20 60 C20 20, 200 20, 200 60 C200 100, 20 100, 20 60" stroke="#e0e0e0" stroke-width="1" fill="none"/>
                        <path d="M40 60 C40 30, 180 30, 180 60 C180 90, 40 90, 40 60" stroke="#4caf50" stroke-width="1" stroke-dasharray="4 2" fill="none"/>
                        <circle cx="20" cy="60" r="4" fill="#4caf50" />
                        <circle cx="200" cy="60" r="4" fill="#4caf50" />
                    </svg>
                </div>
            </div>
            
            <div class="lr-layout-main">
                <div class="main-content">
                    <router-view />
                </div>
                
                <div class="main-decoration">
                    <svg width="160" height="160" viewBox="0 0 160 160" fill="none" xmlns="http://www.w3.org/2000/svg">
                        <rect width="160" height="160" fill="transparent" />
                        <path d="M0 80 L80 0 L160 80 L80 160 Z" stroke="#f0f0f0" stroke-width="1" fill="none"/>
                        <circle cx="80" cy="80" r="40" stroke="#f0f0f0" stroke-width="1" fill="none"/>
                        <circle cx="80" cy="80" r="20" stroke="#f0f0f0" stroke-width="1" fill="none"/>
                    </svg>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    name: 'LRLayout',
    methods: {
        goToHome() {
            this.$router.push('/')
        }
    }
}
</script>

<style scoped>
.lr-layout-container {
    min-height: 100vh;
    width: 100%;
    background-color: #f5f7fa;
    display: flex;
    flex-direction: column;
    position: relative;
}

.lr-layout-header {
    height: 80px;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0 40px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

.back-home-btn {
    font-size: 15px;
    padding: 10px 20px;
    border-radius: 8px;
    background: linear-gradient(90deg, #4caf50 0%, #81c784 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
}

.back-home-btn:hover {
    background: linear-gradient(90deg, #3b9c3f 0%, #6ebb71 100%);
    transform: translateX(-4px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.back-home-btn i {
    margin-right: 4px;
    transition: transform 0.3s ease;
}

.back-home-btn:hover i {
    transform: translateX(-2px);
}

.lr-layout-content {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.lr-layout-sidebar {
    width: 340px;
    background: linear-gradient(135deg, #4caf50 0%, #81c784 100%);
    padding: 100px 40px 40px;
    color: white;
    position: relative;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    margin-bottom: 60px;
    text-align: center;
}

.logo-container {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.platform-name {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px;
    letter-spacing: 0.5px;
}

.platform-slogan {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
}

.sidebar-features {
    margin-top: 40px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.feature-icon i {
    font-size: 24px;
}

.feature-info h3 {
    font-size: 18px;
    margin: 0 0 5px;
    font-weight: 600;
}

.feature-info p {
    font-size: 14px;
    margin: 0;
    opacity: 0.8;
}

.sidebar-decoration {
    margin-top: auto;
    display: flex;
    justify-content: center;
}

.lr-layout-main {
    flex: 1;
    padding: 100px 40px 40px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}

.main-content {
    width: 100%;
    position: relative;
    z-index: 2;
}

.main-decoration {
    position: absolute;
    bottom: 20px;
    right: 20px;
    opacity: 0.2;
    z-index: 1;
}

@media (max-width: 992px) {
    .lr-layout-content {
        flex-direction: column;
    }
    
    .lr-layout-sidebar {
        width: 100%;
        padding: 100px 20px 40px;
    }
    
    .lr-layout-main {
        padding: 40px 20px;
    }
    
    .sidebar-features {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        justify-content: center;
    }
    
    .feature-card {
        width: calc(50% - 10px);
        margin-bottom: 0;
    }
    
    .sidebar-decoration {
        display: none;
    }
}

@media (max-width: 576px) {
    .lr-layout-header {
        padding: 0 20px;
    }
    
    .sidebar-features {
        flex-direction: column;
    }
    
    .feature-card {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .logo-container {
        width: 80px;
        height: 80px;
    }
    
    .platform-name {
        font-size: 24px;
    }
}
</style>